<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./../css/baicaijia.css">
    <!-- <script src="./../js/baicaijia.js"></script> -->
</head>

<body>
    <header id="header">
        <a href="./../index.html" class="back fl"></a>
        <h4>白菜价-淘宝内部优惠券</h4>
        <div class="app fr">
            <a href="">
                <img src="./../assets/images/header_app.png" alt="">
            </a>
        </div>
    </header>
    <nav id="box">
            <ul class="navList" style="width: 910px">
                <!-- <li data-titleid="0">全部</li>
                <li data-titleid="1">热销</li>
                <li data-titleid="2">9块钱邮</li>
                <li data-titleid="3">19块邮</li>
                <li data-titleid="4">数码家电</li>
                <li data-titleid="5">居家</li>
                <li data-titleid="6">美食</li>
                <li data-titleid="7">男装</li>
                <li data-titleid="8">女装</li>
                <li data-titleid="9">鞋包配饰</li>
                <li data-titleid="10">文体</li>
                <li data-titleid="11">母婴</li>
                <li data-titleid="12">美妆</li> -->
            </ul>
    </nav>
    <section >
        <ul id="prouduct">
            <li >
                <a href class="clearfix im">
                    <div class="img fl">
                        <img src="" alt="">
                    </div>
                    <div class="infoR">
                        <div class="title">
                            <h4>
                                <span class="b">[包邮]</span>
                                "双十一红包 今日开启"
                            </h4>
                            <div class="price">
                                <em>￥</em>
                                "0.0"
                                <del>￥0</del>
                                <del>1888.0</del>
                            </div>
                            <div class="down">
                                <div class="bar">
                                    <div class="bar_in" style="width:118px">100%</div>
                                </div>
                                <span class="yiling">已领126张/剩余0张</span>
                                <div class="click">
                                    <div class="left">点击领取优惠券</div>
                                    <div class="right">下单链接</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </a>
            </li>
        </ul>
    </section>

    <section id="footer">
        <div class="more">
            <a href="">更多优惠信息</a>
        </div>
        <div class="chart">
            <span class="chart_in fl">品牌排行</span>
            <span class="more fr">
                <img src="./../assets/images/more.png" alt="">
            </span>
        </div>
        <div class="login">
            <div class="container">
                <div class="ro">
                    <a href="">
                        <div class="col-xs-3">登入</div>
                    </a>
                    <a href="">
                        <div class="col-xs-4">注册</div>
                    </a>
                    <a href="">
                        <div class="col-xs-5">返回顶部</div>
                    </a>
                    <span></span>
                </div>
            </div>
            <div class="content_b">
                <p>
                    <a href="#">
                        手机APP下载
                    </a>
                    <a href="#">
                        万锋智慧商城手机版
                    </a>
                    -- 掌上比价平台
                </p>
                <p>
                    chst.vip:8081/crm </p>
            </div>
        </div>
    </section>

</body>
<script>
    fetch("http://chst.vip:1234/api/getbaicaijiatitle?tiled&title", {
        method: "get"
    })
        .then(body => body.json())
        .then(res => {
            let obox = document.querySelector(".navList")
            // console.log(res);
            let text = ""
            res.result.forEach(item => {
                // console.log(item);
              text +=  `<li data-titleid="${item.titleId}">${item.title}</li>`

            });
            // console.log(text);
            obox.innerHTML = text
        })
fetch("http://chst.vip:1234/api/getbaicaijiaproduct?titleid=1",{
    method:"get"
})    
.then(body=>body.json())
.then(res=>{
    let pd=document.querySelector("#prouduct")
    console.log(res)
    let xhr=""
    res.result.forEach(item=>{
        xhr+=`<ul>
            <a href=""${item.productCoupon}></a>
            <img src="${item.productImg}" alt="">
            <a href=""></a>
            <span class=""${item.productName}></span>
            <div></div>
            <i></i>
            </ul>`
    })
    pd.innerHTML=xhr
})
</script>

</html>